package com.hmall.cart.config;

import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author liuyp
 * @since 2025/11/14
 */
@Configuration
public class RabbitConfig {
    /**
     * 配置json消息转换器，不要导错了：
     *  org.springframework.amqp.support.converter.MessageConverter
     *  org.springframework.amqp.support.converter.Jackson2JsonMessageConverter
     */
    @Bean
    public MessageConverter jsonMessageConverter(){
        return new Jackson2JsonMessageConverter();
    }
}
